#include <bits/stdc++.h>

using namespace std;
/*
2
3 2
1 2
2 3
Alice
5 6
1 2
1 3
2 3
2 4
3 5
4 5
Alice
*/
/* result should be
Alice
Bob
*/
const int MAX_SIZE = 10;// just for simple test
int main() 
{
    freopen("file.in","r",stdin);
    int t, n, m, v1, v2, cost = 1;
    int Graph[MAX_SIZE][MAX_SIZE] = {0};
    string name;
    cin >> t;
    for (int ii = 0; ii < t; ii++)
    {
        cin >> n >> m;
        for (int j = 0; j < m; j++)
        {
            cin >> v1 >> v2;
            Graph[v1][v2] = INT_MAX;
        }
        cin >> name;
        
        // PreBuild Costmap BFS
        for (int i = n; i >=1; i--)
        {
            for (int j = 1; j <= n; j++)
            {
                if (Graph[j][i] != 0 && Graph[j][i] > cost)
                {
                    Graph[j][i] = cost;
                }
            }
            cost++;
        }

        // start point
        v1 = 1;
        cost = INT_MAX;
        bool Aturn = false;
        bool defi = false;
        // find result
        if(name[0] = 'A')
            Aturn = false;
        else
            Aturn = true;

        while (v1 != n)
        {
            for (int j = 1; j <= n; j++)
            {
                if (Graph[v1][j]!=0 && Graph[v1][j] < cost && Graph[v1][j]%2==0 && !Aturn)
                {
                    v2 = j;
                    cost = Graph[v1][j];
                    defi = true;
                }
                else if (Graph[v1][j]!=0 && Graph[v1][j] < cost && Graph[v1][j]%2==1 && Aturn)
                {
                    v2 = j;
                    cost = Graph[v1][j];
                    defi = true;
                }
            }
            if(defi)
            {
                v1 = v2;
                Aturn = !Aturn;
                defi = false;
            }
            else
            {
                Aturn = !Aturn;
                break;
            }
        }

        if(Aturn)
            cout << "Bob" << endl;
        else
            cout << "Alice" << endl;
    }


    return 0;
}
